set -e

echo "设置允许通过SSH密码登录"
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
systemctl restart sshd.service

echo "设置hosts"
cat > /etc/hosts << EOF
192.168.3.3 server
EOF

echo "设置主机别名"
cat > /home/vagrant/.ssh/config << EOF
Host server
HostName 192.168.3.3
User vagrant
EOF

echo "复制安装脚本"
ln -s /vagrant/scripts/setup.sh /usr/bin/setup

